package cn.com.generaldata.os.pojo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.xml.bind.annotation.XmlTransient;

import com.sun.xml.internal.bind.CycleRecoverable;

public class Billboard implements java.io.Serializable, CycleRecoverable {

	private static final long serialVersionUID = -7087955231516525528L;

	private String id;
	private User operator;
	private String billboardTitle;
	private String billboardContent;
	private Date billboardDate;
	private String billboardIndustryId;

	public String getBillboardIndustryId() {
		return billboardIndustryId;
	}

	public void setBillboardIndustryId(String billboardIndustryId) {
		this.billboardIndustryId = billboardIndustryId;
	}

	private Set<BillboardUser> billboardUsers = new HashSet<BillboardUser>(0);

	public Billboard() {
	}

	public Billboard(String id, User operator, String billboardTitle, String billboardContent, Date billboardDate,
			String billboardIndustryId) {
		super();
		this.id = id;
		this.operator = operator;
		this.billboardTitle = billboardTitle;
		this.billboardContent = billboardContent;
		this.billboardDate = billboardDate;
		this.billboardIndustryId = billboardIndustryId;
	}

	public Billboard(String id, User operator, String billboardTitle, String billboardContent, Date billboardDate,
			Set<BillboardUser> billboardUsers, String billboardIndustryId) {
		this.id = id;
		this.operator = operator;
		this.billboardTitle = billboardTitle;
		this.billboardContent = billboardContent;
		this.billboardDate = billboardDate;
		this.billboardUsers = billboardUsers;
		this.billboardIndustryId = billboardIndustryId;
	}

	public Billboard(String id, User operator, String billboardTitle, String billboardContent, Date billboardDate) {
		this.id = id;
		this.operator = operator;
		this.billboardTitle = billboardTitle;
		this.billboardContent = billboardContent;
		this.billboardDate = billboardDate;
	}

	public Billboard(String id, User operator, String billboardTitle, String billboardContent, Date billboardDate,
			Set<BillboardUser> billboardUsers) {
		this.id = id;
		this.operator = operator;
		this.billboardTitle = billboardTitle;
		this.billboardContent = billboardContent;
		this.billboardDate = billboardDate;
		this.billboardUsers = billboardUsers;
	}

	/**
	 * 解决CXF循环引用问题.
	 * 
	 * @param arg0
	 * @return
	 */
	@Override
	public Object onCycleDetected(Context arg0) {
		Billboard temp = new Billboard();
		temp.setId(id);
		return temp;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public User getOperator() {
		return operator;
	}

	public void setOperator(User operator) {
		this.operator = operator;
	}

	public String getBillboardTitle() {
		return billboardTitle;
	}

	public void setBillboardTitle(String billboardTitle) {
		this.billboardTitle = billboardTitle;
	}

	public String getBillboardContent() {
		return billboardContent;
	}

	public void setBillboardContent(String billboardContent) {
		this.billboardContent = billboardContent;
	}

	public Date getBillboardDate() {
		return billboardDate;
	}

	public void setBillboardDate(Date billboardDate) {
		this.billboardDate = billboardDate;
	}

	@XmlTransient
	public Set<BillboardUser> getBillboardUsers() {
		return billboardUsers;
	}

	public void setBillboardUsers(Set<BillboardUser> billboardUsers) {
		this.billboardUsers = billboardUsers;
	}

}
